<script setup="">
import Card from "../help/Card.vue";
import { ref } from 'vue'

const tableData = ref([
  {rank:1,name:"黄添",id:4030539,group:3,before:90,middle:98,after:90,total:96.4,level:"优"},
  {rank:2,name:"李吉祥",id:4030535,group:2,before:91,middle:91,after:91,total:91,level:"优"},
  {rank:3,name:"郑天齐",id:4030536,group:3,before:93,middle:90,after:93,total:90.6,level:"优"},
  {rank:4,name:"陈云洁",id:4030537,group:3,before:95,middle:88,after:95,total:89.4,level:"良"},
  {rank:5,name:"王慕尧",id:4030540,group:3,before:91,middle:89,after:91,total:89.4,level:"良"},
  {rank:6,name:"耿超然",id:4030534,group:2,before:90,middle:89,after:90,total:89.2,level:"良"},
  {rank:7,name:"唐政",id:4030538,group:3,before:96,middle:87,after:96,total:88.8,level:"良"},
  {rank:8,name:"钱皓天",id:4030552,group:6,before:89,middle:87,after:89,total:87.4,level:"良"},
  {rank:9,name:"任飞洋",id:4030532,group:2,before:91,middle:84,after:91,total:85.4,level:"良"},
  {rank:10,name:"叶凯文",id:4030542,group:4,before:91,middle:83,after:91,total:84.6,level:"良"},
  {rank:11,name:"揭子旭",id:4030544,group:4,before:90,middle:83,after:90,total:84.4,level:"良"},
  {rank:12,name:"陈俊哲",id:4030531,group:2,before:90,middle:80,after:90,total:82,level:"良"},
  {rank:13,name:"黄伟",id:4030541,group:4,before:90,middle:80,after:90,total:82,level:"良"},
  {rank:14,name:"郑博文",id:4030554,group:6,before:90,middle:80,after:90,total:82,level:"良"},
  {rank:15,name:"孔笑男",id:4030528,group:1,before:86,middle:81,after:86,total:82,level:"良"},
  {rank:16,name:"张增杰",id:4030545,group:4,before:91,middle:78,after:91,total:80.6,level:"良"},
  {rank:17,name:"王琪",id:4030533,group:2,before:88,middle:78,after:88,total:80,level:"合"},
  {rank:18,name:"王欣怡",id:4030526,group:1,before:86,middle:78,after:86,total:79.6,level:"合"},
  {rank:19,name:"甘余超",id:4030555,group:6,before:91,middle:76,after:91,total:79,level:"合"},
  {rank:20,name:"胡泽贤",id:4030529,group:1,before:84,middle:77,after:84,total:78.4,level:"合"},
  {rank:21,name:"张元硕",id:4030543,group:4,before:88,middle:75,after:88,total:77.6,level:"合"},
  {rank:22,name:"冉子健",id:4030551,group:6,before:88,middle:75,after:88,total:77.6,level:"合"},
  {rank:23,name:"李佳彬",id:4030546,group:5,before:88,middle:73,after:88,total:76,level:"合"},
  {rank:24,name:"陈家毅",id:4030530,group:1,before:89,middle:72,after:89,total:75.4,level:"合"},
  {rank:25,name:"高梓涵",id:4030548,group:5,before:86,middle:72,after:86,total:74.8,level:"合"},
  {rank:26,name:"徐菲儿",id:4030527,group:1,before:88,middle:71,after:88,total:74.4,level:"合"},
  {rank:27,name:"李乐祥",id:4030553,group:6,before:88,middle:70,after:88,total:73.6,level:"合"},
  {rank:28,name:"詹程宇昊",id:4030547,group:5,before:87,middle:70,after:87,total:73.4,level:"合"},
  {rank:29,name:"王晨昕",id:4030549,group:5,before:87,middle:69,after:87,total:72.6,level:"合"},
  {rank:30,name:"冯家运",id:4030550,group:5,before:85,middle:60,after:85,total:65,level:"合"},

])
const columns = [
  { label: '排名', prop: 'rank'},
  { label: '姓名', prop: 'name'},
  { label: '学号', prop: 'id'},
  { label: '组别', prop: 'group'},
  { label: '课前', prop: 'before'},
  { label: '课中', prop: 'middle'},
  { label: '课后', prop: 'after'},
  { label: '总成绩', prop: 'total'},
]

const emits = defineEmits(['row-click'])
</script>


<template>
  <div class="basis-3/5 animate__animated animate__fadeInBottomRight w-full h-full overflow-x-scroll">
    <Card title="个人成绩">
      <el-table :data="tableData" stripe style="width: 100%" scrollbar-always-on   @row-click="(row) => emits('row-click',row)">
        <template #empty>
          <el-empty description="暂无数据" />
        </template>
        <el-table-column v-for="(column,idx) in columns"
                         :key="idx"
                         :prop="column.prop"
                         :label="column.label"
        />
      </el-table>
    </Card>
  </div>
</template>
